
<html>
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
   <script type="text/javascript" src="/themes/Sbodycarving/public/order/js/jquery-1.9.1.min.js"></script>
      <script type="text/javascript" src="/themes/Sbodycarving/public/assets/js/layer/layer.js"></script>
	<link rel="stylesheet" type="text/css" href="/plugins/pay_zhl/view/public/assets/wxzf.css">
	<title>微信支付</title>
  <php>
		if($param['order_status']!=0){
	</php>
		<script>
			$(function () {
				layer.msg('该订单已支付');
				setTimeout("location.href='/'",1000);
			})
		</script>
	<php>}</php>
	<script type="text/javascript">
        //调用微信JS api 支付
        function jsApiCall()
        {
            WeixinJSBridge.invoke(
                'getBrandWCPayRequest',
            <?php echo $jsApiParameters; ?>,
            function(res){
               if(res.err_msg=='get_brand_wcpay_request:ok'){
                  layer.msg('支付成功');
                  }
              if(res.err_msg=='get_brand_wcpay_request:cancel'){
                   layer.msg('用户取消');
                  }
              if(res.err_msg=='get_brand_wcpay_request:fail'){
                 layer.msg('支付失败');
                  
                  }
              setTimeout("location.href='/user/order/index/order_no/{$param['Out_trade_no']}.html';", 1000);
              
            }
        );
        }

        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }
	</script>
	<script type="text/javascript">
        //获取共享地址
        function editAddress()
        {
            WeixinJSBridge.invoke(
                'editAddress',
            <?php echo $editAddress; ?>,
            function(res){
                var value1 = res.proviceFirstStageName;
                var value2 = res.addressCitySecondStageName;
                var value3 = res.addressCountiesThirdStageName;
                var value4 = res.addressDetailInfo;
                var tel = res.telNumber;
				console.log(value1 + value2 + value3 + value4 + ":" + tel)
                //alert(value1 + value2 + value3 + value4 + ":" + tel);
            }
        );
        }

        window.onload = function(){
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', editAddress, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', editAddress);
                    document.attachEvent('onWeixinJSBridgeReady', editAddress);
                }
            }else{
                editAddress();
            }
        };

	</script>
</head>
<body>

<div class="header">
	<div class="all_w ">
		<div class="gofh"> <a href="javascript:history.back(-1);"><img src="/plugins/pay_zhl/view/public/assets/images/jt_03.jpg" ></a> </div>
		<div class="ttwenz">
			<h4>确认交易</h4>
			<h5>微信安全支付</h5>
		</div>
	</div>
</div>
<div class="wenx_xx">
	<div class="mz">7S细胞疗法体雕大师</div>
	<div class="wxzf_price">￥{$param['Total_fee']}</div>
</div>
<div class="skf_xinf">
	<div class="all_w"> <span class="bt">订单号</span> <span class="fr">{$param['Out_trade_no']}</span> </div>
</div>
<a href="javascript:void(0);" class="ljzf_but all_w" onclick="callpay()" >立即支付</a>
<br/>

</body>
</html>